package com.hnas.trade.domain;

public enum PaymentType {

	WX("0","微信"),
	QBYE("1","钱包余额");

	private String type;
	private String description;

	private PaymentType(String type, String description) {
		this.type = type;
		this.description = description;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public static PaymentType getPaymentType(String key) {
        for (PaymentType paymentType : PaymentType.values()) {
            if (paymentType.getType().equals(key)) {
               return paymentType;
           }
        }
   return null;
}

public static String getPaymentTypeString(String key) {
return getPaymentType(key)==null?"":getPaymentType(key).getDescription();
}
}
